package com.ruoyi.yipaiju.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yipaiju.mapper.AccessLogMapper;
import com.ruoyi.yipaiju.domain.AccessLog;
import com.ruoyi.yipaiju.service.IAccessLogService;

/**
 * 浏览记录Service业务层处理
 * 
 * @author liuwp
 * @date 2023-03-10
 */
@Service
public class AccessLogServiceImpl implements IAccessLogService 
{
    @Autowired
    private AccessLogMapper accessLogMapper;

    /**
     * 查询浏览记录
     * 
     * @param id 浏览记录主键
     * @return 浏览记录
     */
    @Override
    public AccessLog selectAccessLogById(Long id)
    {
        return accessLogMapper.selectAccessLogById(id);
    }

    /**
     * 查询浏览记录列表
     * 
     * @param accessLog 浏览记录
     * @return 浏览记录
     */
    @Override
    public List<AccessLog> selectAccessLogList(AccessLog accessLog)
    {
        return accessLogMapper.selectAccessLogList(accessLog);
    }

    /**
     * 根据业务主键查询一条记录：浏览记录
     *
     * @param accessLog 浏览记录
     * @return 浏览记录
     */
    @Override
    public AccessLog selectOneAccessLog(AccessLog accessLog)
    {
        return accessLogMapper.selectOneAccessLog(accessLog);
    }

    /**
     * 新增浏览记录
     * 
     * @param accessLog 浏览记录
     * @return 结果
     */
    @Override
    public int insertAccessLog(AccessLog accessLog)
    {
        accessLog.setCreateTime(DateUtils.getNowDate());
        return accessLogMapper.insertAccessLog(accessLog);
    }

    /**
     * 修改浏览记录
     * 
     * @param accessLog 浏览记录
     * @return 结果
     */
    @Override
    public int updateAccessLog(AccessLog accessLog)
    {
        return accessLogMapper.updateAccessLog(accessLog);
    }

    @Override
    public int updateAccessLogCondition(AccessLog accessLog, AccessLog accessLogCondition)
    {
        return accessLogMapper.updateAccessLogCondition(accessLog, accessLogCondition);
    }

    /**
     * 批量删除浏览记录
     * 
     * @param ids 需要删除的浏览记录主键
     * @return 结果
     */
    @Override
    public int deleteAccessLogByIds(Long[] ids)
    {
        return accessLogMapper.deleteAccessLogByIds(ids);
    }

    /**
     * 删除浏览记录信息
     * 
     * @param id 浏览记录主键
     * @return 结果
     */
    @Override
    public int deleteAccessLogById(Long id)
    {
        return accessLogMapper.deleteAccessLogById(id);
    }

    /**
     * 条件删除浏览记录
     *
     * @param accessLog 浏览记录
     * @return 结果
     */
    @Override
    public int deleteAccessLogByCondition(AccessLog accessLog)
    {
        return accessLogMapper.deleteAccessLogByCondition(accessLog);
    }

}
